Skip to content

Conversation

@nedanwr
Copy link
Owner

@nedanwr nedanwr commented Jan 16, 2026

Description

This PR introduces comprehensive PDF OCR (Optical Character Recognition) and metadata management capabilities to forgekit. Users can now:

  • OCR: Add searchable text layers to scanned PDFs using ocrmypdf, with support for multiple languages, deskewing, and text detection
  • Metadata Management: Read and write PDF metadata (title, author, subject, keywords, etc.) using exiftool

The implementation includes new CLI commands (forgekit pdf ocr and forgekit pdf metadata), core library enhancements for job specifications, and tool adapters for Ocrmypdf and ExifTool.

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation only
  • refactor: Code refactoring (no behavior change)
  • perf: Performance improvement
  • test: Adding or updating tests
  • build: Build system or dependencies
  • ci: CI/workflow changes
  • chore: Maintenance tasks

Scope

  • cli - CLI commands and interface
  • core - Core library functionality
  • tools - Tool integrations (qpdf, ghostscript, etc.)
  • pdf - PDF-specific operations
  • packaging - Package configurations
  • Other:

Related Issues

Checklist

  • I have read the commit convention
  • My commits follow the conventional format: type(scope): description
  • I have added/updated tests as appropriate
  • All tests pass locally (cargo test)
  • Code passes lint checks (cargo clippy and cargo fmt)
  • I have updated documentation if needed

Breaking Changes

  • This PR contains breaking changes

Key Changes

CLI Commands

  • Added forgekit pdf ocr command with support for:
    • Language selection (e.g., eng, deu, fra)
    • Deskewing for tilted scans
    • Force OCR mode for re-processing
    • Skip-text mode for mixed PDFs
  • Added forgekit pdf metadata command with support for:
    • Reading all metadata (forgekit pdf metadata doc.pdf)
    • Getting specific fields (--get title)
    • Setting multiple fields (--set title="My Doc" --set author="John")

Core Library

  • Added Ocrmypdf tool adapter for OCR operations
  • Added ExifTool adapter for metadata management
  • Enhanced JobSpec with PdfOcr and PdfMetadata variants
  • Added MetadataAction enum for metadata operations (Get, GetAll, Set)
  • Integrated OCR and metadata operations into job executor with progress reporting

Version

  • Bumped version to 0.0.5 for core packages and workspace

@nedanwr nedanwr self-assigned this Jan 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nedanwr nedanwr merged commit 4fde02e into develop Jan 16, 2026
5 checks passed
@nedanwr nedanwr deleted the feat/pdf-ocr-metadata branch January 16, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants